home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 4 / Gold Medal Software - Volume 4 (Gold Medal) (1994).iso / os2 / excal.arj / EXCAL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-07-13  |  7KB  |  149 lines

  1. /* Example of the REXX interface to ExCal                             */
  2. /*                                                                    */
  3. /* Those setting up many ExCal users (e.g., a LAN administrator) may  */
  4. /* want to use REXX to create an ExCal with their own places and      */
  5. /* event objects.  This REXX command file creates the same objects as */
  6. /* does the EXCINST installation routine.  The primary difference is  */
  7. /* this command file has no error checking and only does              */
  8. /* installations.  See "Programming API" in the ExCal online help for */
  9. /* more details.                                                      */
  10. /*                                                                    */
  11. /* Note: The SysSetObjectData only accepts object IDs for folder      */
  12. /*       objects; paths are not accepted.  As a result, the           */
  13. /*       Calendar must be created with an object ID.  I believe       */
  14. /*       this is a REXX bug, since WinSetObjectData/WinQueryObject    */
  15. /*       together work with either folder or data file objects.       */
  16. /*                                                                    */
  17. /* CHANGE 'excalDLLpath' BELOW TO WHERE YOU COPIED EXCAL.DLL!         */
  18.  
  19. excalDLLpath = '' /* remember the trailing slash, eg, 'C:\EXCAL\' */
  20. excalDLL = excalDLLpath || "EXCAL.DLL";
  21.  
  22. signal on novalue
  23.  
  24. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs';
  25. Call SysLoadFuncs;           
  26.  
  27. /* start by creating the ExCal folders */
  28.  
  29. rc = SysCreateObject("WPFolder", "ExCal Folder", ,
  30.     "<WP_DESKTOP>", "OBJECTID=<EXCAL_INSTALLFOLDER>", "Update");
  31. rc = SysCreateObject("WPFolder", "Event Templates", ,
  32.     "<EXCAL_INSTALLFOLDER>", "OBJECTID=<EXCAL_EVENTSFOLDER>", "Update");
  33. rc = SysCreateObject("WPFolder", "Places", ,
  34.     "<EXCAL_INSTALLFOLDER>", "OBJECTID=<EXCAL_PLACESFOLDER>", "Update");
  35.  
  36. /* Register superclass of ExEvent and ExPlace */
  37.  
  38. rc = SysRegisterObjectClass("ExTransient", excalDLL);
  39.  
  40. /* create the event alarm and time class */
  41.  
  42. rc = SysRegisterObjectClass("ExTime", excalDLL);
  43. rc = SysRegisterObjectClass("ExAlarm", excalDLL);
  44. rc = SysCreateObject("ExAlarm", "ExCal.ALM", ,
  45.     "<WP_DESKTOP>", "NOTVISIBLE=YES;OBJECTID=<EXCAL_ALARM>", "Update");
  46.  
  47. /* create places */
  48.  
  49. rc = SysRegisterObjectClass("ExPlace", excalDLL);
  50.  
  51. rc = SysCreateObject("ExPlace", "Favorite Place", ,
  52.     "<EXCAL_PLACESFOLDER>", "MAKEDEFAULT=YES", "Update");
  53. rc = SysCreateObject("ExPlace", "Office", ,
  54.     "<EXCAL_PLACESFOLDER>", "ICONRESOURCE=12 " || excalDLL, "Update");
  55. rc = SysCreateObject("ExPlace", "Restaurant", ,
  56.     "<EXCAL_PLACESFOLDER>", "ICONRESOURCE=9 " || excalDLL, "Update");
  57. rc = SysCreateObject("ExPlace", "Tourist Spot", ,
  58.     "<EXCAL_PLACESFOLDER>", "ICONRESOURCE=10 " || excalDLL, "Update");
  59. rc = SysCreateObject("ExPlace", "Vacation Spot", ,
  60.     "<EXCAL_PLACESFOLDER>", "ICONRESOURCE=11 " || excalDLL, "Update");
  61. rc = SysCreateObject("ExPlace", "Classroom", ,
  62.     "<EXCAL_PLACESFOLDER>", "ICONRESOURCE=13 " || excalDLL, "Update");
  63. rc = SysCreateObject("ExPlace", "Doctor's Office", ,
  64.     "<EXCAL_PLACESFOLDER>", "ICONRESOURCE=14 " || excalDLL, "Update");
  65. rc = SysCreateObject("ExPlace", "Home", ,
  66.     "<EXCAL_PLACESFOLDER>", "ICONRESOURCE=8 " || excalDLL, "Update");
  67. rc = SysCreateObject("ExPlace", "None", ,
  68.     "<EXCAL_PLACESFOLDER>", "ICONRESOURCE=20 " || excalDLL, "Update");
  69.  
  70. /* create events */
  71.  
  72. rc = SysRegisterObjectClass("ExEvent", excalDLL);
  73.  
  74. rc = SysCreateObject("ExEvent", "Morning Meeting", "<EXCAL_EVENTSFOLDER>", ,
  75.      "TEMPLATE=YES;STARTTIME=9:00;ENDTIME=10:00;PLACE=Office;ALARM=ON;",
  76.      "Update");
  77. rc = SysCreateObject("ExEvent", "Afternoon Meeting", "<EXCAL_EVENTSFOLDER>", ,
  78.      "TEMPLATE=YES;STARTTIME=13:00;ENDTIME=14:00;PLACE=Office;ALARM=ON;", ,
  79.      "Update");
  80. rc = SysCreateObject("ExEvent", "Vacation", "<EXCAL_EVENTSFOLDER>", ,
  81.      "TEMPLATE=YES;STARTTIME=9:00;ENDTIME=17:00;" || ,
  82.      "PLACE=Vacation Spot;PERSONAL=YES;",
  83.      "Update");
  84. rc = SysCreateObject("ExEvent", "Seminar", "<EXCAL_EVENTSFOLDER>", ,
  85.      "TEMPLATE=YES;STARTTIME=13:00;ENDTIME=17:00;PLACE=Classroom;", ,
  86.      "Update");
  87. rc = SysCreateObject("ExEvent", "Chores", "<EXCAL_EVENTSFOLDER>", ,
  88.      "TEMPLATE=YES;STARTTIME=19:00;ENDTIME=21:00;PLACE=Home;", ,
  89.      "Update");
  90. rc = SysCreateObject("ExEvent", "Lunch", "<EXCAL_EVENTSFOLDER>", ,
  91.      "TEMPLATE=YES;STARTTIME=12:00;ENDTIME=13:00;PLACE=Restaurant;", ,
  92.      "Update");
  93. rc = SysCreateObject("ExEvent", "Morning Meeting", "<EXCAL_EVENTSFOLDER>", ,
  94.      "TEMPLATE=YES;STARTTIME=9:00;ENDTIME=10:00;PLACE=Office;ALARM=ON;",
  95.      "Update");
  96. rc = SysCreateObject("ExEvent", "Afternoon Meeting", "<EXCAL_EVENTSFOLDER>", ,
  97.      "TEMPLATE=YES;STARTTIME=13:00;ENDTIME=14:00;PLACE=Office;ALARM=ON;", ,
  98.      "Update");
  99. rc = SysCreateObject("ExEvent", "Vacation", "<EXCAL_EVENTSFOLDER>", ,
  100.      "TEMPLATE=YES;STARTTIME=9:00;ENDTIME=17:00;" || ,
  101.      "PLACE=Vacation Spot;PERSONAL=YES;",
  102.      "Update");
  103. rc = SysCreateObject("ExEvent", "Seminar", "<EXCAL_EVENTSFOLDER>", ,
  104.      "TEMPLATE=YES;STARTTIME=13:00;ENDTIME=17:00;PLACE=Classroom;", ,
  105.      "Update");
  106. rc = SysCreateObject("ExEvent", "Chores", "<EXCAL_EVENTSFOLDER>", ,
  107.      "TEMPLATE=YES;STARTTIME=19:00;ENDTIME=21:00;PLACE=Home;", ,
  108.      "Update");
  109. rc = SysCreateObject("ExEvent", "Medical Appointment", "<EXCAL_EVENTSFOLDER>", ,
  110.      "TEMPLATE=YES;STARTTIME=10:00;ENDTIME=11:00;PLACE=Doctor's Office;", ,
  111.      "Update");
  112.  
  113. rc = SysCreateObject("ExEvent", "Travel", "<EXCAL_EVENTSFOLDER>", ,
  114.      "TEMPLATE=YES;STARTTIME=12:00;ENDTIME=15:00;PLACE=None;" || ,
  115.      "ICONRESOURCE=15 " || excalDLL, "Update");
  116. rc = SysCreateObject("ExEvent", "Conference Call", "<EXCAL_EVENTSFOLDER>", ,
  117.     "TEMPLATE=YES;STARTTIME=8:30;ENDTIME=9:30;PLACE=Office;" || ,
  118.      "ICONRESOURCE=16 " || excalDLL, "Update");
  119. rc = SysCreateObject("ExEvent", "Urgent!", "<EXCAL_EVENTSFOLDER>", ,
  120.      "TEMPLATE=YES;STARTTIME=12:00;ENDTIME=12:00;PLACE=None;ALARM=ON;" || ,
  121.      "ICONRESOURCE=18 " || excalDLL, "Update");
  122. rc = SysCreateObject("ExEvent", "Reminder", "<EXCAL_EVENTSFOLDER>", ,
  123.      "TEMPLATE=YES;STARTTIME=9:00;ENDTIME=9:00;PLACE=None;ALARM=ON;" || ,
  124.      "PERSONAL=YES;ICONRESOURCE=23 " || excalDLL, "Update");
  125. rc = SysCreateObject("ExEvent", "Special", "<EXCAL_EVENTSFOLDER>", ,
  126.      "TEMPLATE=YES;STARTTIME=12:00;ENDTIME=12:00;PLACE=None;" || ,
  127.      "ICONRESOURCE=17 " || excalDLL, "Update");
  128.  
  129. /* create calendar */
  130.  
  131. rc = SysRegisterObjectClass("ExCalendar", excalDLL);
  132.  
  133. rc = SysCreateObject("ExCalendar", "ExCal", "<EXCAL_INSTALLFOLDER>", ,
  134.      "OBJECTID=<EXCAL_CALENDAR>", "Update");
  135.  
  136. /* create address book */
  137.  
  138. rc = SysRegisterObjectClass("ExPerson", excalDLL);
  139. rc = SysRegisterObjectClass("ExAddressBook", excalDLL);
  140.  
  141. rc = SysCreateObject("ExAddressBook", "Address Book", "<EXCAL_INSTALLFOLDER>", ,
  142.      "ALWAYSSORT=YES;OBJECTID=<EXCAL_ADDRESSBOOK>", "Update");
  143.  
  144. /* done, open the install folder */
  145.  
  146. rc = SysSetObjectData("<EXCAL_INSTALLFOLDER>", ,
  147.      "ICONRESOURCE=19 " || excalDLL);
  148. rc = SysSetObjectData("<EXCAL_INSTALLFOLDER>", "OPEN=DEFAULT");
  149.